package com.pda.gongpin.adapter;

import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.pda.gongpin.R;
import com.pda.gongpin.bean.ManifestBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

public class ManifestAdapter extends BaseAdapter<ManifestBean> {
    public ManifestAdapter(int layoutResId, @Nullable List<ManifestBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ManifestBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_originOrderNum,"入库单号： "+item.getOriginOrderNum());
        ManifestListAdapter adapter=new ManifestListAdapter(R.layout.item_manifest_list,item.getAbnormalDataDetailVos());
        RecyclerView recyclerView=helper.getView(R.id.rv_content);
        recyclerView.setAdapter(adapter);
        adapter.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
                getOnItemClickListener().onItemClick(ManifestAdapter.this,helper.itemView,helper.getAdapterPosition());
            }
        });
    }
}
